import { App } from 'vue'
import { createRouter, createWebHashHistory } from 'vue-router'
import { createRouterGuards } from './router-guards';

const Home = () => import('@/layouts/Home.vue')
// const Layout = () => import('@/components/Layout.vue')

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
  },
//   {
//     path: '/about',
//     component: About,
//   },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

export function setupRouter(app: App):void {
  app.use(router);
  // 创建路由守卫
  createRouterGuards(router);
}

export default router
